package exam.xiecheng.spring.S2;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] chs = s.toCharArray();
        int minCost = Math.min(getCost(chs, '0'), getCost(chs, '1'));
        System.out.println(minCost);
    }

    public static int getCost(char[] chs, char c) {
        int cost = 0;
        char d = c == '0' ? '1' : '0';
        for (int i=0; i<chs.length; ++i) {
            char e = i % 2 == 0 ? c : d;
            cost = chs[i] == e ? cost : cost + i + 1;
        }
        return cost;
    }
}